/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import entity.Product;
import java.util.List;

/**
 *
 * @author SONY
 */
public class Paginator {
    
    public List<Product> getSubList(int currentpage, int N, int maxsize, List<Product> orginalList) {
        int start = currentpage * N;
        int end = (currentpage * N + N > maxsize ? maxsize : currentpage * N + N);
        List<Product> lstProducts = orginalList.subList(start, end);
        return lstProducts;
    }
    
}
